0 CpxTRS
↳1 DependencyGraphProof (BOTH BOUNDS(ID, ID), 0 ms)
↳2 CpxTRS
↳3 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳4 CpxWeightedTrs
↳5 CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID), 0 ms)
↳6 CpxWeightedTrs
↳7 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)
↳8 CpxTypedWeightedTrs
↳9 CompletionProof (UPPER BOUND(ID), 0 ms)
↳10 CpxTypedWeightedCompleteTrs
↳11 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 0 ms)
↳12 CpxRNTS
↳13 CompleteCoflocoProof (⇔, 41 ms)
↳14 BOUNDS(1, 1)
+(x, 0) → x
+(x, i(x)) → 0
+(+(x, y), z) → +(x, +(y, z))
*(x, +(y, z)) → +(*(x, y), *(x, z))
*(+(x, y), z) → +(*(x, z), *(y, z))
+(x, i(x)) → 0
+(x, 0) → x
+(x, i(x)) → 0 [1]
+(x, 0) → x [1]
+ => plus |
plus(x, i(x)) → 0 [1]
plus(x, 0) → x [1]
plus(x, i(x)) → 0 [1]
plus(x, 0) → x [1]
plus :: i:0 → i:0 → i:0 i :: i:0 → i:0 0 :: i:0 |
plus(v0, v1) → null_plus [0]
null_plus
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
0 => 0
null_plus => 0
plus(z, z') -{ 1 }→ x :|: x >= 0, z = x, z' = 0
plus(z, z') -{ 1 }→ 0 :|: z' = 1 + x, x >= 0, z = x
plus(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
eq(start(V, V1),0,[plus(V, V1, Out)],[V >= 0,V1 >= 0]). eq(plus(V, V1, Out),1,[],[Out = 0,V1 = 1 + V2,V2 >= 0,V = V2]). eq(plus(V, V1, Out),1,[],[Out = V3,V3 >= 0,V = V3,V1 = 0]). eq(plus(V, V1, Out),0,[],[Out = 0,V4 >= 0,V5 >= 0,V = V4,V1 = V5]). input_output_vars(plus(V,V1,Out),[V,V1],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. non_recursive : [plus/3]
1. non_recursive : [start/2]
#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into plus/3
1. SCC is partially evaluated into start/2
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations plus/3
* CE 3 is refined into CE [6]
* CE 5 is refined into CE [7]
* CE 4 is refined into CE [8]
### Cost equations --> "Loop" of plus/3
* CEs [6,7] --> Loop 4
* CEs [8] --> Loop 5
### Ranking functions of CR plus(V,V1,Out)
#### Partial ranking functions of CR plus(V,V1,Out)
### Specialization of cost equations start/2
* CE 2 is refined into CE [9,10]
### Cost equations --> "Loop" of start/2
* CEs [9,10] --> Loop 6
### Ranking functions of CR start(V,V1)
#### Partial ranking functions of CR start(V,V1)
Computing Bounds
=====================================
#### Cost of chains of plus(V,V1,Out):
* Chain [5]: 1
with precondition: [V1=0,V=Out,V>=0]
* Chain [4]: 1
with precondition: [Out=0,V>=0,V1>=0]
#### Cost of chains of start(V,V1):
* Chain [6]: 1
with precondition: [V>=0,V1>=0]
Closed-form bounds of start(V,V1):
-------------------------------------
* Chain [6] with precondition: [V>=0,V1>=0]
- Upper bound: 1
- Complexity: constant
### Maximum cost of start(V,V1): 1
Asymptotic class: constant
* Total analysis performed in 26 ms.